package com.kingyea.mobilepolice.organization.service;

import com.kingyea.mobilepolice.organization.bean.Organization;
import com.kingyea.mobilepolice.organization.bean.OrganizationCondition;
import com.kingyea.mobilepolice.organization.bean.OrganizationVo;
import com.kingyea.mobilepolice.system.Result;
import com.kingyea.mobilepolice.userorg.bean.UserOrg;
import com.kingyea.mobilepolice.userorg.bean.UserOrgCondition;

import java.util.List;
import java.util.Map;

/**
 * @author Mr.Lin
 * @version v1.0.0
 * @description Organization 接口
 * @date Created in 2018-03-30 15:26:51
 */
public interface OrganizationService {

    /**
     * 通过ID查找对象
     *
     * @param orgId
     * @return
     */
    Organization getById(Integer orgId) throws Exception;

    /**
     * @Description: 根据serialNo唯一序列号查找对象
     * @Param: [serialNo]
     * @return: com.kingyea.mobilepolice.organization.bean.Organization
     * @Author: cxc
     * @Date: 2018.04.12 18:07
     */
    public Organization getBySerialNo(String serialNo);

    /**
     * 列表
     *
     * @param condition
     * @return
     */
    List<Organization> search(OrganizationCondition condition) throws Exception;

    /**
     * 通过条件获取数据
     */
    List<Organization> queryByCondition(OrganizationCondition condition) throws Exception;

    /**
     * 删除
     *
     * @param orgId
     * @return
     */
    int deleteById(Integer orgId);

    /**
     * 添加
     *
     * @param organization
     * @return
     */
    Organization save(Organization organization) throws Exception;

    /**
     * 更新
     *
     * @param organization
     * @return
     */
    Organization update(Organization organization) throws Exception;

    /**
     * @Description: 部门树结构数据
     * @Param: [condition]
     * @return: java.util.List<com.kingyea.mobilepolice.organization.bean.Organization>
     * @Author: cxc
     * @Date: 2018.04.08 16:57
     */
    List<OrganizationVo> searchTree(OrganizationCondition condition);

    List<Organization> parentDeptList() throws Exception;

    List<Organization> list(Map<String, Object> map);



    /**
     * @Description: 删除用户管理的所有部门依赖
     * @Param: [userSerialNo]
     * @return: java.lang.Boolean
     * @Author: cxc
     * @Date: 2018.04.09 10:36
     */
    Boolean delAllOrgByUserSerialNo(String userSerialNo);

    /**
     * @Description: 批量添加用户管理的所有部门
     * @Param: [userOrgList]
     * @return: java.lang.Boolean
     * @Author: cxc
     * @Date: 2018.04.09 10:37
     */
    Boolean addAllOrgOfUser(String userSerialNo, List<UserOrg> userOrgList);

    /**
     * @Description: 搜索用户管理的所有部门
     * @Param: [userSerialNo]
     * @return: java.util.List<com.kingyea.mobilepolice.organization.bean.Organization>
     * @Author: cxc
     * @Date: 2018.04.09 10:38
     */
    List<OrganizationVo> searchAllOrgOfUser(String userSerialNo);

    /**
     * @Description: 搜索用户管理的部门
     * @Param: [userSerialNo]
     * @return: java.util.List<com.kingyea.mobilepolice.organization.bean.Organization>
     * @Author: cxc
     * @Date: 2018.04.09 10:38
     */
    List<Organization> search(UserOrgCondition userOrgCondition);

    /**
     * @Description: 查询用户是否拥有权限控制部门
     * @Param: [userId, orgSerialNo]
     * @return: java.lang.Boolean
     * @Author: cxc
     * @Date: 2018.04.13 09:58
     */
    Boolean exist(String userId, String orgSerialNo);

    List<OrganizationVo> searchPctree(OrganizationCondition condition);

    /**
     *@Description 查询最高级和自己所在的部门
     *@Param: []
     *@return: com.kingyea.mobilepolice.system.Result
     *@Author: lgy
     *@Date: 2018/8/20 0020
     */
    Result selectByMyDept();

    /**
     *@Description 查询自己所在的部门以下部门和人员
     *@Param: [orgId]
     *@return: com.kingyea.mobilepolice.system.Result
     *@Author: lgy
     *@Date: 2018/8/20 0020
     */
    Result searchMyDept(String orgId);

    /**
     *@Description 查询部门信息和上级部门（部门名片使用）
     *@Param: [orgId]
     *@return: com.kingyea.mobilepolice.system.Result
     *@Author: lgy
     *@Date: 2018/8/20 0020
     */
    Result searchCard(String orgId);

    /**
     *@Description 查询个人信息（个人名片使用）
     *@Param: [userId]
     *@return: com.kingyea.mobilepolice.system.Result
     *@Author: lgy
     *@Date: 2018/8/20 0020
     */
    Result searchPersionCard(String userId);

    /**
     *@Description 模糊查询，根据名称查询部门和用户
     *@Param: [name]
     *@return: com.kingyea.mobilepolice.system.Result
     *@Author: lgy
     *@Date: 2018/8/20 0020
     */
    Result searchByName(Organization name);

}
